import VueRouter from 'vue-router'

//引入组件
import Index from '../pages/IndexPage.vue'
import Home from '../pages/home/HomePage.vue'


const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				}]
            },
        ]
    })